﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Controls_Payment : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btndathang_Click(object sender, EventArgs e)
    {
       
        Invetory inventory = new Invetory();
        string s = Guid.NewGuid().ToString();
        inventory.Inv_ID = s;
        inventory.Inv_CreateDate = DateTime.Now;
        inventory.Inv_TotalPrice = ManageBasket.Basket.Summary;
        inventory.Inv_TotalQuantity = ManageBasket.Basket.Count;
        inventory.Int_Status = 0;
        inventory.User_ID = int.Parse(Session["User_ID"].ToString());
        inventory.Inv_UserRevice = txthoten.Text;
        inventory.Inv_UserRevicePhone = txtdienthoai.Text;
        inventory.Inv_UserReviceAddress = txtdiachi.Text;
        inventory.Inv_PayType = int.Parse(drlhinhthucthanhtoan.SelectedValue);
        inventory.Inv_DateRevice = Convert.ToDateTime(txtthoigiangiaohang.Text);
        inventory.Local_ID = int.Parse(drldiadiemgiaohang.SelectedValue);
        inventory.Inv_Note = txtghichu.Text;
        inventory.Inv_UserReviceEmail = txtEmail.Text;

        Invetory_session.Insert_Invetory(inventory);
        //ManageBasket.InsertProductIntoTable(s);  //cai nay chua duoic nek
        Response.Redirect("Default.aspx");
        
    }
}
